<?php
include 'checkSession.php';
$pageName = "SignPost";
if(isset($_REQUEST['action'])) {
	if($_REQUEST['action'] == 'edit' || $_REQUEST['action'] == 'view' || $_REQUEST['action'] == 'chPass') {
		$editQry = mysql_fetch_array(mysql_query("SELECT *
													   FROM `Sign_Posts`
													   WHERE `sp_id` = '".$_REQUEST['id']."'"));
		$editActivityQry = mysql_fetch_array(mysql_query("SELECT *
													   FROM `Post_Activity`
													   WHERE `pa_post_id` = '".$_REQUEST['id']."'"));
													   
		
		$sp_id = $editQry['sp_id'];
	}
	if($_REQUEST['action'] == 'add') {
	$idQry = mysql_fetch_array(mysql_query("SELECT *
													   FROM `Sign_Posts`
													   ORDER BY `sp_id` DESC"));
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Sign Inventory</title>
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
	<script type="text/javascript">
function validationBuyerAdd() {
		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
		var char=/^[0-9]+$/;
		var operatorFirstname = document.operatorForm.operatorFirstname.value;
		var operatorLastname = document.operatorForm.operatorLastname.value;
		var operatorPhone = document.operatorForm.operatorPhone.value;
		var operatorpassword = document.operatorForm.operatorpassword.value;
		
		if(operatorFirstname =="" || operatorFirstname == 0 || operatorFirstname.replace(/^\s+|\s+$/g,"").length == 0) {
			alert("First Name should not be empty or blank! Please enter First Name");
			document.operatorForm.operatorFirstname.focus();return false;
		}
		if(operatorLastname =="" || operatorLastname == 0 || operatorLastname.replace(/^\s+|\s+$/g,"").length == 0) {
			alert("Last Name should not be empty or blank! Please enter Last Name");
			document.sign_postsForm.sign_postsLastname.focus();return false;
		}
		if(sign_postsPhone =="" || sign_postsPhone == 0 || sign_postsPhone.replace(/^\s+|\s+$/g,"").length == 0) {
			alert("Phone Number should not be empty or blank! Please enter Phone Number");
			document.sign_postsForm.sign_postsPhone.focus();return false;
		}
		if (check_exit(sign_postsPhone)==false){
			alert("Phone Number already Exit.");
			document.sign_postsForm.sign_postsPhone.select();return false;
		}
		if(sign_postspassword =="" || sign_postspassword == 0 || sign_postspassword.replace(/^\s+|\s+$/g,"").length == 0) {
			alert("Password should not be empty or blank! Please enter Password");
			document.operatorForm.operatorpassword.focus();return false;
		}
			return true;
	}
	
	function validationBuyerEdit() {
		var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
		var char=/^[0-9]+$/;
		var userName = document.operatorForm.userName.value;
		var userPhoneNumber = document.operatorForm.userPhoneNumber.value;
		
		if(userName =="" || userName == 0 || userName.replace(/^\s+|\s+$/g,"").length == 0) {
			alert("Name should not be empty or blank! Please enter Name");
			document.operatorForm.userName.focus();return false;
		}
		return true;
	}
	
	function validationChangePassword(){
			var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
			var char=/^[0-9]+$/;
			var oldPassword = document.changePassword.oldPassword.value;
			var newPassword = document.changePassword.newPassword.value;
			var newCPassword = document.changePassword.newCPassword.value;
			
			if(oldPassword =="" || oldPassword == 0 || oldPassword.replace(/^\s+|\s+$/g,"").length == 0) {
				alert("Please enter old password");
				document.changePassword.oldPassword.focus();return false;
			}
			if(newPassword =="" || newPassword == 0 || newPassword.replace(/^\s+|\s+$/g,"").length == 0) {
				alert("Please enter new password");
				document.changePassword.newPassword.focus();return false;
			}
			if(newCPassword =="" || newCPassword == 0 || newCPassword.replace(/^\s+|\s+$/g,"").length == 0) {
				alert("Please enter confirm password");
				document.changePassword.newCPassword.focus();return false;
			}
			if(newCPassword != newPassword) {
				alert("Please doesnot match. Try again.");
				document.changePassword.newCPassword.focus();return false;
			}
			return true;
	}
	
		
		

</script>
<script type="text/javascript" src="datePicker/jsDatePick.min.1.3.js"></script>
<link rel="stylesheet" type="text/css" href="datePicker/jsDatePick_ltr.min.css" />

<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"sp_date_installed",
			dateFormat:"%m-%d-%Y"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
		new JsDatePick({
			useMode:2,
			target:"sp_date_last_insp",
			dateFormat:"%m-%d-%Y"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
		
		new JsDatePick({
			useMode:2,
			target:"sp_date_next_insp",
			dateFormat:"%m-%d-%Y"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
	};
</script>
</head>
<body>
<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php include "header-top.php";?>
		<!-- End Logo + Top Nav -->
		
		<!-- Main Nav -->
		<?php include "menu-tab.php";?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container"  style=" height:auto;">
	<div class="shell">
		
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Sign Post</a>
			</div>
		<!-- End Small Nav -->
		
		<!-- Message OK -->
		<!-- End Message OK -->
        <!-- Message Error -->
        <!-- End Message Error -->
        <br />
		<!-- Main -->
		<div id="main"  style=" height:auto;">
	<?php if($_REQUEST['action'] == "add" || $_REQUEST['action'] == "edit") {
?>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="69%" height="30"><?php
				if(isset($_REQUEST['msg'])) {
					if($_REQUEST['msg'] == '3') {
						echo "DATA SAVED";
					}
				}
				?></td>
				<td width="31%" height="30" align="left" valign="top"><a href="signPostList.php">List Sign Post</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
		  </table>
		  <?php }
		  if($_REQUEST['action'] == "view") {
		  ?>
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="60%" height="30">&nbsp;</td>
				<td width="40%" height="30" align="left" valign="top"> <a href="signPostManager.php?action=add" class="pageLink"><b>Create New</b></a>|<a href="signPostList.php" class="menuLink"><b>List Sign Post</b></a></td>
			  </tr>
		  </table>
		
		  <?php }?>
			<div class="cl">&nbsp;</div>
			
			<!-- Content -->
			<div id="content" style="width:940px;">
				
				<!-- Box -->
				<!-- End Box -->
                <!-- Box -->
<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2>
						<?php
						if($_REQUEST['action'] == 'edit') {
						echo '<strong>Edit Sign Post</strong>';
						}
						
						if($_REQUEST['action'] == 'add') {
						echo '<strong>ADD SIGN POST TO GALLERY</strong>';
						}
						if($_REQUEST['action'] == 'chPass') {
						echo '<strong>View Sign Post</strong>';
						}
						?>	
						</h2>
					</div>
					<!-- End Box Head -->
					
					
						
				<div>
				<?php if($_REQUEST['action'] == "add" || $_REQUEST['action'] == "edit") {
?>
				<!------------------------------------------------------------>
				<form method="post" name="signPostForm" id="signPostForm" action="signPostManagerAction.php" enctype="multipart/form-data">
				  <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border:1px #3263AA solid;">
                    <tr>
                      <td height="10" colspan="6" style=" font-size:11px;">&nbsp;</td>
                    </tr>
                    <tr>
                      <td width="1%" height="15" style=" font-size:11px;">&nbsp;</td>
                      <td width="18%" height="15" style=" font-size:11px;">&nbsp;</td>
                      <td height="15" colspan="4" align="right" style="font-size:12px;">&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;"><span style="font-size:12px; padding-left:10px;">Sign Post ID </span></td>
                      <td width="28%" height="30" style=" font-size:12px; font-weight:bold;"><?php 
					  if($_REQUEST['action'] == 'edit') {
					  	echo @$sp_id;
					  } 
					  if($_REQUEST['action'] == 'add') {
					  	echo $idQry['sp_id']+1;
					  }
					  ?></td>
                      <td width="0%">&nbsp;</td>
                      <td width="16%"><input type="hidden" name="sp_catalog_item_yesno" value="1" />
                      <span style=" font-size:12px; padding-left:10px;">Status</span></td>
                      <td width="37%"><select name="sp_status" style="width:200px;">
                        <option value="ACTIVE" <?php if($editQry['sp_status'] == "ACTIVE") { ?> selected="selected"<?php } ?>>ACTIVE</option>
                        <option value="INACTIVE" <?php if($editQry['sp_status'] == "INACTIVE") { ?> selected="selected"<?php } ?>>INACTIVE</option>
                        <option value="RETIRED" <?php if($editQry['sp_status'] == "RETIRED") { ?> selected="selected"<?php } ?>>RETIRED</option>
                      </select></td>
                    </tr>
                   <?php /*?> <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;"><!--Catalog--></td>
                      <td height="30"><select name="sp_catalog_item_yesno" style="width:200px;">
                          <option value="1" <?php if($editQry['sp_catalog_item_yesno'] == "1") { ?> selected="selected"<?php } ?>>Yes</option>
                          <option value="2" <?php if($editQry['sp_catalog_item_yesno'] == "2") { ?> selected="selected"<?php } ?>>No</option>
                          <option value="3" <?php if($editQry['sp_catalog_item_yesno'] == "3") { ?> selected="selected"<?php } ?>>Unset</option>
                      </select></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;"><!--Client--></span></td>
                      <td><input type="text" name="sp_master_client" id="sp_master_client" size="30" value="<?php echo @$editQry['sp_master_client']?>"/></td>
                    </tr><?php */?>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">Installed</td>
                      <td height="30"><input type="text" name="sp_date_installed" id="sp_date_installed" size="30" value="<?php if($editQry['sp_date_installed'] != "0000-00-00") { if(date('m-d-Y',strtotime($editQry['sp_date_installed'])) != "12-31-1969") { echo date('m-d-Y',strtotime($editQry['sp_date_installed'])); } }?>" readonly="" disabled="disabled"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px; color:#FF0000;">Inspected</span></td>
                      <td><input type="text" name="sp_date_last_insp" id="sp_date_last_insp" size="30" value="<?php if($editQry['sp_date_last_insp'] != "0000-00-00") { if(date('m-d-Y',strtotime($editQry['sp_date_last_insp'])) != "12-31-1969") { echo date('m-d-Y',strtotime($editQry['sp_date_last_insp'])); } } ?>" readonly="" disabled="disabled"/></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Action Needed</td>
                      <td height="30"><select name="sp_action_needed" style="width:200px;">
                         <?php foreach ($arrAN as $keyAN => $ANValue) { 
						if($editQry['sp_action_needed'] == $keyAN) {
						$selectAN = 'selected';
						} else {
						$selectAN = '';
						}
					?>
				<option value="<?php echo $keyAN; ?>" <?php echo $selectAN;?>><?php echo $ANValue; ?></option>
				<?php } ?>
                      </select></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px; color:#FF0000;">Next Inspection</span></td>
                      <td><input type="text" name="sp_date_next_insp" id="sp_date_next_insp" size="30" value="<?php if($editQry['sp_date_next_insp'] != "0000-00-00") { if(date('m-d-Y',strtotime($editQry['sp_date_next_insp'])) != "12-31-1969") { echo date('m-d-Y',strtotime($editQry['sp_date_next_insp'])); } }?>" readonly="" disabled="disabled"/></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Agency</td>
                      <td height="30"><select name="sp_agency" style="width:200px;">
                          <?php foreach ($arrAgency as $keyAgency => $agencyValue) { 
						if($editQry['sp_agency'] == $keyAgency) {
						$selectAgency = 'selected';
						} else {
						$selectAgency = '';
						}
					?>
				<option value="<?php echo $keyAgency; ?>" <?php echo $selectAgency;?>><?php echo $agencyValue; ?></option>
				<?php } ?>
                      </select></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">District</span></td>
                      <td><select name="sp_district" style="width:200px;">
                           <?php foreach ($arrDistrict as $keyDistrict => $DistrictValue) { 
						if($editQry['sp_district'] == $keyDistrict) {
						$selectDistrict = 'selected';
						} else {
						$selectDistrict = '';
						}
					?>
				<option value="<?php echo $keyDistrict; ?>" <?php echo $selectAgency;?>><?php echo $DistrictValue; ?></option>
				<?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Standard</td>
                      <td height="30"><select name="sp_standard" style="width:200px;">
					   <?php foreach ($arrSTANDARD as $keySTANDARD => $STANDARDValue) { 
						if($editQry['sp_standard'] == $keySTANDARD) {
						$selectSTANDARD = 'selected';
						} else {
						$selectSTANDARD = '';
						}
					?>
				<option value="<?php echo $keySTANDARD; ?>" <?php echo $selectSTANDARD;?>><?php echo $STANDARDValue; ?></option>
				<?php } ?>
                          
                      </select></td>
                      <td>&nbsp;</td>
                      <td><span style="font-size:12px; padding-left:10px;">Condition</span></td>
                      <td>
					  <select name="sp_condition" style="width:200px;">
					   <?php foreach ($arrCOND as $keyCOND => $CONDValue) { 
						if($editQry['sp_condition'] == $keyCOND) {
						$selectCOND = 'selected';
						} else {
						$selectCOND = '';
						}
					?>
				<option value="<?php echo $keyCOND; ?>" <?php echo $selectCOND;?>><?php echo $CONDValue; ?></option>
				<?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left" style="background-color:#3263AA; color:#FFFFFF;">
                      <td height="30" bgcolor="#3263AA" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" bgcolor="#3263AA" style=" font-size:12px;"><strong>Details</strong></td>
                      <td height="30" bgcolor="#3263AA">&nbsp;</td>
                      <td bgcolor="#3263AA">&nbsp;</td>
                      <td bgcolor="#3263AA">&nbsp;</td>
                      <td bgcolor="#3263AA">&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;">&nbsp;</td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Size 1</td>
                      <td height="30"><input type="text" name="sp_dimension1" id="sp_dimension1" size="30" value="<?php echo @$editQry['sp_dimension1']?>"/></td>
                      <td>&nbsp;</td>
                      <td><span style="font-size:12px; padding-left:10px;">Type</span></td>
                      <td><select name="sp_type" style="width:200px;">
                        <?php foreach ($arrTYPE as $keyTYPE => $TYPEValue) { 
						if($editQry['sp_type'] == $keyTYPE) {
						$selectTYPE = 'selected';
						} else {
						$selectTYPE = '';
						}
					?>
                        <option value="<?php echo $keyTYPE; ?>" <?php echo $selectTYPE;?>><?php echo $TYPEValue; ?></option>
                        <?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Size 2</td>
                      <td height="30"><input type="text" name="sp_dimension2" id="sp_dimension2" size="30" value="<?php echo @$editQry['sp_dimension2']?>"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Material</span></td>
                      <td><select name="sp_material" style="width:200px;">
                        <?php foreach ($arrMATER as $keyMATER => $MATERValue) { 
						if($editQry['sp_material'] == $keyMATER) {
						$selectMATER = 'selected';
						} else {
						$selectMATER = '';
						}
					?>
                        <option value="<?php echo $keyMATER; ?>" <?php echo $selectMATER;?>><?php echo $MATERValue; ?></option>
                        <?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Length</td>
                      <td height="30"><input type="text" name="sp_length" id="sp_length" size="30" value="<?php echo @$editQry['sp_length']?>"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Mounting</span></td>
                      <td><select name="sp_mounting" style="width:200px;">
                        <?php foreach ($arrMOUNT as $keyMOUNT => $MOUNTValue) { 
						if($editQry['sp_mounting'] == $keyMOUNT) {
						$selectMOUNT = 'selected';
						} else {
						$selectMOUNT = '';
						}
					?>
                        <option value="<?php echo $keyMOUNT; ?>" <?php echo $selectMOUNT;?>><?php echo $MOUNTValue; ?></option>
                        <?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Num of Posts</td>
                      <td height="30"><select name="sp_num_posts" style="width:200px;">
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                      </select></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Breakaway</span></td>
                      <td><select name="sp_breakaway" style="width:200px;">
                        <?php foreach ($arrBKW as $keyBKW => $BKWValue) { 
						if($editQry['sp_breakaway'] == $keyBKW) {
						$selectBKW = 'selected';
						} else {
						$selectBKW = '';
						}
					?>
                        <option value="<?php echo $keyBKW; ?>" <?php echo $selectBKW;?>><?php echo $BKWValue; ?></option>
                        <?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;"><span style="font-size:12px; padding-left:10px;">Cost</span></td>
                      <td height="30"><input type="text" name="sp_cost" id="sp_cost" size="10" value="<?php echo @$editQry['sp_cost']?>"/>USD</td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Topper</span></td>
                      <td><select name="sp_topper_type" style="width:200px;">
                        <?php foreach ($arrTOPTYP as $keyTOPTYP => $TOPTYPValue) { 
						if($editQry['sp_topper_type'] == $keyTOPTYP) {
						$selectTOPTYP = 'selected';
						} else {
						$selectTOPTYP = '';
						}
					?>
                        <option value="<?php echo $keyTOPTYP; ?>" <?php echo $selectTOPTYP;?>><?php echo $TOPTYPValue; ?></option>
                        <?php } ?>
                      </select></td>
                    </tr>
                    <tr align="left" style="background-color:#3263AA; color:#FFFFFF;">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;"><strong>Location</strong></td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;">&nbsp;</td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">Street</td>
                      <td height="30"><input type="text" name="sp_street1" id="sp_street1" size="30" value="<?php echo @$editQry['sp_street1']?>" disabled="disabled"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px; color:#FF0000;">Longitude</span></td>
                      <td><input type="text" name="sp_longitude" id="sp_longitude" size="30" value="<?php echo @$editQry['sp_longitude']?>" disabled="disabled"/></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">Cross Street</td>
                      <td height="30"><input type="text" name="sp_street2" id="sp_street2" size="30" value="<?php echo @$editQry['sp_street2']?>" disabled="disabled"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px; color:#FF0000;">Latitude</span></td>
                      <td><input type="text" name="sp_latitude" id="sp_latitude" size="30" value="<?php echo @$editQry['sp_latitude']?>" disabled="disabled"/></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">Other Street</td>
                      <td height="30"><input type="text" name="sp_street3" id="sp_street3" size="30" value="<?php echo @$editQry['sp_street3']?>" disabled="disabled"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px; color:#FF0000;">Intersection Dist</span></td>
                      <td><input type="text" name="sp_distance_intersection" id="sp_distance_intersection" size="30" value="<?php echo @$editQry['sp_distance_intersection']?>" disabled="disabled"/></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">&nbsp;</td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px; color:#FF0000;">Edge of Pavement</span></td>
                      <td><input type="text" name="sp_distance_eop" id="sp_distance_eop" size="30" value="<?php echo @$editQry['sp_distance_eop']?>" disabled="disabled"/></td>
                    </tr>
                     <tr align="left" style="background-color:#3263AA; color:#FFFFFF;">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;">&nbsp;</td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                     <tr align="left">
                       <td height="30" style=" font-size:11px;">&nbsp;</td>
                       <td height="30" style=" font-size:12px;">&nbsp;</td>
                       <td height="30">&nbsp;</td>
                       <td>&nbsp;</td>
                       <td>&nbsp;</td>
                       <td>&nbsp;</td>
                     </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Custom1</td>
                      <td height="30"><input type="text" name="sp_custom1" id="sp_custom1" size="30" value="<?php echo @$editQry['sp_custom1']?>"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Yes/No1</span></td>
                      <td><select name="sp_yes_no1" style="width:200px;">
                        <option value="1" <?php if($editQry['sp_yes_no1'] == "1") { ?> selected="selected"<?php } ?>>Yes</option>
                        <option value="2" <?php if($editQry['sp_yes_no1'] == "2") { ?> selected="selected"<?php } ?>>No</option>
                        <option value="3" <?php if($editQry['sp_yes_no1'] == "3") { ?> selected="selected"<?php } ?>>Unset</option>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Custom2</td>
                      <td height="30"><input type="text" name="sp_custom2" id="sp_custom2" size="30" value="<?php echo @$editQry['sp_custom2']?>"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Yes/No2</span></td>
                      <td><select name="sp_yes_no2" style="width:200px;">
                        <option value="1" <?php if($editQry['sp_yes_no2'] == "1") { ?> selected="selected"<?php } ?>>Yes</option>
                        <option value="2" <?php if($editQry['sp_yes_no2'] == "2") { ?> selected="selected"<?php } ?>>No</option>
                        <option value="3" <?php if($editQry['sp_yes_no2'] == "3") { ?> selected="selected"<?php } ?>>Unset</option>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">Custom3</td>
                      <td height="30"><input type="text" name="sp_custom3" id="sp_custom3" size="30" value="<?php echo @$editQry['sp_custom3']?>"/></td>
                      <td>&nbsp;</td>
                      <td><span style=" font-size:12px; padding-left:10px;">Yes/No3</span></td>
                      <td><select name="sp_yes_no3" style="width:200px;">
                        <option value="1" <?php if($editQry['sp_yes_no3'] == "1") { ?> selected="selected"<?php } ?>>Yes</option>
                        <option value="2" <?php if($editQry['sp_yes_no3'] == "2") { ?> selected="selected"<?php } ?>>No</option>
                        <option value="3" <?php if($editQry['sp_yes_no3'] == "3") { ?> selected="selected"<?php } ?>>Unset</option>
                      </select></td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px;">&nbsp;</td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                     <tr align="left" style="background-color:#3263AA; color:#FFFFFF;">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;">&nbsp;</td>
                      <td height="30">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                     <tr align="left">
                       <td height="30" style=" font-size:11px;">&nbsp;</td>
                       <td height="30" style=" font-size:12px;">&nbsp;</td>
                       <td height="30">&nbsp;</td>
                       <td>&nbsp;</td>
                       <td>&nbsp;</td>
                       <td>&nbsp;</td>
                     </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">Comments</td>
                      <td height="30"><textarea name="sp_comments" cols="35" rows="5" disabled="disabled"><?php echo @$editQry['sp_comments']?></textarea></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
					<?php if($_REQUEST['action'] == 'edit') {?>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px;">&nbsp;</td>
                      <td height="30"><img src="photo/<?php echo @$editQry['sp_photo']?>" width="100" height="100" /></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
					<?php } ?>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">Photo</td>
                      <td height="30"><input type="file" name="sp_photo" id="sp_photo" size="25" disabled="disabled"/></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" style=" font-size:11px;">&nbsp;</td>
                      <td height="30" style=" font-size:12px; padding-left:10px; color:#FF0000;">History</td>
                      <td height="30">
					  <textarea name="pa_activity" cols="35" rows="5" disabled="disabled"><?php echo @$editActivityQry['pa_activity']?></textarea>					  </td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="30" colspan="2">&nbsp;</td>
                      <td height="30" colspan="4">&nbsp;</td>
                    </tr>
                    <tr align="left">
                      <td height="30" colspan="2">&nbsp;</td>
                      <td height="30" colspan="4"><?php if($_REQUEST['action'] == 'add') {
	?>
                          <input type="submit" name="Add" value="Add" class="button" onclick="return validationBuyerAdd()"/>
                          <input type="reset" name="reset" value="Reset" class="button" onclick="resetEditor()"/>
                          <?php
		}
		if($_REQUEST['action'] == 'edit') {
		?>
                          <input type="hidden" name="sp_id" id="sp_id" value="<?php echo $sp_id;?>" />
                          <input type="submit" name="Edit" value="Update" class="button" onclick="return validationBuyerEdit()"/>
						  <input type="button" name="addsignface" value="ADD SIGN FACE" class="button" onclick="window.location.href='signFaceManager.php?action=add&sp_id=<?php echo $sp_id;?>'"/>
						   <input type="button" name="addsignface" value="SHOW SIGN LIST" class="button" onclick="window.location.href='signFaceList.php?sp_id=<?php echo $sp_id;?>'"/>
                          <?php 
		}
		?>                      </td>
                    </tr>
                    <tr>
                      <td height="30" colspan="2">&nbsp;</td>
                      <td height="30" colspan="4">&nbsp;</td>
                    </tr>
                  </table>
				</form>
				<!------------------------------------------------------------->
		
		<?php
}
if($_REQUEST['action'] == "view") {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  
  <tr>
    <td height="10" colspan="4" style=" font-size:11px;">&nbsp;</td>
    </tr>
  <tr>
    <td width="1%" height="15" style=" font-size:11px;">&nbsp;</td>
    <td width="19%" height="15" style=" font-size:11px;">&nbsp;</td>
    <td height="15" colspan="2" align="right" style="font-size:12px;">&nbsp;&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Catalog</td>
    <td width="51%" height="30">
	<?php echo @$editQry['sp_catalog_item_yesno']?>
	
	</select>	</td>
    <td width="29%">&nbsp;</td>
  </tr>

  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Client</td>
    <td height="30"><?php echo @$editQry['sp_master_client']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Longitude </td>
    <td height="30"><?php echo @$editQry['sp_longitude']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Latitude</td>
    <td height="30"><?php echo @$editQry['sp_latitude']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Installed</td>
    <td height="30"><?php echo @$editQry['sp_date_installed']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Inspected</td>
    <td height="30"><?php echo @$editQry['sp_date_last_insp']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Next Inspection</td>
    <td height="30"><?php echo @$editQry['sp_date_next_insp']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Agency</td>
    <td height="30">
	<?php echo @$editQry['sp_agency']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>District</td>
    <td height="30">
	<?php echo @$editQry['sp_district']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Standard</td>
    <td height="30">
	<?php echo @$editQry['sp_standard']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Type</td>
    <td height="30">
	<?php echo @$editQry['sp_type']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Size 1</td>
    <td height="30"><?php echo @$editQry['sp_dimension1']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Size 2 </td>
    <td height="30"><?php echo @$editQry['sp_dimension2']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Length</td>
    <td height="30"><?php echo @$editQry['sp_length']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Num of Posts</td>
    <td height="30">
	<?php echo @$editQry['sp_num_posts']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Material</td>
    <td height="30">
	<?php echo @$editQry['sp_material']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Mounting</td>
    <td height="30">
	<?php echo @$editQry['sp_mounting']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Breakaway</td>
    <td height="30">
	<?php echo @$editQry['sp_breakaway']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Topper</td>
    <td height="30">
	<?php echo @$editQry['sp_topper_type']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Condition</td>
    <td height="30">
	<?php echo @$editQry['sp_condition']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Action Needed</td>
    <td height="30">
	<?php echo @$editQry['sp_action_needed']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Street</td>
    <td height="30"><?php echo @$editQry['sp_street1']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Cross Street</td>
    <td height="30"><?php echo @$editQry['sp_street2']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Other Street</td>
    <td height="30"><?php echo @$editQry['sp_street3']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Intersection Dist</td>
    <td height="30"><?php echo @$editQry['sp_distance_intersection']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Edge of Pavement</td>
    <td height="30"><?php echo @$editQry['sp_distance_eop']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Custom1</td>
    <td height="30"><?php echo @$editQry['sp_custom1']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Custom2</td>
    <td height="30"><?php echo @$editQry['sp_custom2']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Custom3</td>
    <td height="30"><?php echo @$editQry['sp_custom3']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Yes/No1</td>
    <td height="30">
	<?php echo @$editQry['sp_yes_no1']?>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Yes/No2</td>
    <td height="30"><?php echo @$editQry['sp_yes_no2']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Yes/No3</td>
    <td height="30"><?php echo @$editQry['sp_yes_no3']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" style=" font-size:11px;">&nbsp;</td>
    <td height="30" style=" font-size:12px;"><em> </em>Comments</td>
    <td height="30">
	<?php echo @$editQry['sp_comments']?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="30" colspan="2">&nbsp;</td>
    <td height="30" colspan="2">&nbsp;</td>
  </tr>
  <tr align="left">
    <td height="30" colspan="2">&nbsp;</td>
    <td height="30" colspan="2">
	
<input type="submit" name="edit" value="Edit" class="button" onclick="window.location.href='signPostManager.php?action=edit&id=<?php echo $sp_id;?>'"/>
<input type="button" name="back" value="Reset" class="button" onclick="window.location.href='signPostList.php'"/>

</td>
  </tr>
  <tr>
    <td height="30" colspan="2">&nbsp;</td>
    <td height="30" colspan="2">&nbsp;</td>
  </tr>
</table>
	<?php
}
?>
                </div>
</div>
				<!-- End Box -->

		  </div>
			<!-- End Content -->
			
			<!-- Sidebar -->
			<!-- End Sidebar -->
<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
<?php include 'footer.php';?>
<!-- End Footer -->
	
</body>
</html>